package org.egedede.processmanager;

import java.util.Collection;
import java.util.List;

import org.egedede.processmanager.utils.IsFinishedPredicate;

import com.google.common.collect.Collections2;

public class ProcessPack {

	private final String label;
	private final List<ProcessDefinition> pack;
	private final ProcessMode mode;

	public ProcessPack(final String label, final List<ProcessDefinition> pack, final ProcessMode mode) {
		this.label = label;
		this.pack = pack;
		this.mode = mode;
	}

	public List<ProcessDefinition> getPack() {
		return pack;
	}

	public ProcessMode getMode() {
		return mode;
	}

	public String getLabel() {
		return label;
	}

	public boolean isFinished() {
		final Collection<ProcessDefinition> filter = Collections2.filter(pack, new IsFinishedPredicate(false));
		return filter.isEmpty();
	}

}
